package com.woniuxy.driverschool.service.impl;/* *
@author author
@create 2021-09-29 20:09
*/

import com.woniuxy.driverschool.entity.TeachProgramme;
import com.woniuxy.driverschool.mapper.TeachProgrammeMapper;
import com.woniuxy.driverschool.service.TeachProgrammeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeachProgrammeServiceImpl implements TeachProgrammeService {

    @Autowired
    TeachProgrammeMapper teachProgrammeMapper;

    @Override
    public void addTeachProgramme(TeachProgramme teachProgramme) {
        teachProgrammeMapper.insertTeachProgramme(teachProgramme);
    }

    @Override
    public void modifyTeachProgramme(TeachProgramme teachProgramme) {
        teachProgrammeMapper.updateTeachProgramme(teachProgramme);
    }

    @Override
    public List<TeachProgramme> getAllTeachProgrammes() {
        return teachProgrammeMapper.selectAllTeachProgramme();
    }

    @Override
    public TeachProgramme getTeachProgrammeById(int teachProgrammeId) {
        return teachProgrammeMapper.selectTeachProgrammeById(teachProgrammeId);
    }

    @Override
    public void removeTeachProgrammeById(int teachProgrammeId) {
        teachProgrammeMapper.deleteTeachProgramme(teachProgrammeId);
    }
}
